<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Lesson Project: C:/Users/ttl/Documents/Lesson/Lesson_Project/T4056_Eternal_Watch/03_Firmware/Temp/User/Driver/KEY/Src/key_driver.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Lesson Project<span id="projectnumber">&#160;Beta V1.1</span>
   </div>
   <div id="projectbrief">Course Learning Template Engineering</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_6d4e12d46ad8519ff7b80e874016d102.html">User</a></li><li class="navelem"><a class="el" href="dir_81f18e0c07fff3e9102b10505e4dbf14.html">Driver</a></li><li class="navelem"><a class="el" href="dir_39b4895addedc8e7310416319f71f4e9.html">KEY</a></li><li class="navelem"><a class="el" href="dir_1315ba3fd6d76f6437e9e1034318dd7b.html">Src</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">key_driver.c</div></div>
</div><!--header-->
<div class="contents">
<a href="key__driver_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#include &quot;<a class="code" href="key__driver_8h.html">key_driver.h</a>&quot;</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="key__driver_8c.html#a17906da8446cb27d67dd9d4f0b42826d">key_init</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="key__driver_8c.html#a4f12cfccd0746cb5d5961dc9556a3dd0">key_task</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="key__driver_8c.html#af9b55c8fe900842c9bf08f4ec8820525">key_get_result</a>(<a class="code hl_enumeration" href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9">key_result_e</a> * key_result);</div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"><a class="line" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">    7</a></span><a class="code hl_struct" href="structkey__driver__t.html">key_driver_t</a> <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[<a class="code hl_enumvalue" href="key__driver_8h.html#ab6420af507afd2c6a57f725ad69d11cbae7c96674990975ac5a27143a3eb4be42">KEY_MAX_TYPE</a>];</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"><a class="line" href="key__driver_8c.html#ae1ed7a538d655ebf902f732c4c064246">    9</a></span><span class="keyword">static</span> QueueHandle_t <a class="code hl_variable" href="key__driver_8c.html#ae1ed7a538d655ebf902f732c4c064246">key_driver_event_queue</a> = NULL;</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="foldopen" id="foldopen00011" data-start="{" data-end="};">
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="key__driver_8c.html#aa38c85bdc6d45115e37716fb056cd79a">   11</a></span><a class="code hl_struct" href="structkey__driver__ops__t.html">key_driver_ops_t</a> <a class="code hl_variable" href="key__driver_8c.html#aa38c85bdc6d45115e37716fb056cd79a">key_driver_ops</a> = {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span>    .<a class="code hl_variable" href="structkey__driver__ops__t.html#ac782f82d4153a23005349b6168768b27">pfinit</a> = <a class="code hl_function" href="key__driver_8c.html#a17906da8446cb27d67dd9d4f0b42826d">key_init</a>,</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span>    .pftask = <a class="code hl_function" href="key__driver_8c.html#a4f12cfccd0746cb5d5961dc9556a3dd0">key_task</a>,</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span>    .pfget_result = <a class="code hl_function" href="key__driver_8c.html#af9b55c8fe900842c9bf08f4ec8820525">key_get_result</a>,</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span>};</div>
</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="foldopen" id="foldopen00017" data-start="{" data-end="}">
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="key__driver_8c.html#a17906da8446cb27d67dd9d4f0b42826d">   17</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="key__driver_8c.html#a17906da8446cb27d67dd9d4f0b42826d">key_init</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>{</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span>    <a class="code hl_variable" href="key__driver_8c.html#ae1ed7a538d655ebf902f732c4c064246">key_driver_event_queue</a> = xQueueCreate(10,<span class="keyword">sizeof</span>(<a class="code hl_enumeration" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621">key_event_e</a>));</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>}</div>
</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span> </div>
<div class="foldopen" id="foldopen00022" data-start="{" data-end="}">
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="key__driver_8c.html#a4f12cfccd0746cb5d5961dc9556a3dd0">   22</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="key__driver_8c.html#a4f12cfccd0746cb5d5961dc9556a3dd0">key_task</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>{</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>    <span class="keyword">static</span> uint32_t key_tick = 0;</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    GPIO_PinState key_status = 0;</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>    uint32_t system_tick = 0;</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>    </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span>    key_status = HAL_GPIO_ReadPin(<a class="code hl_define" href="key__driver_8h.html#ac024ba8a2e4f54e21cbca3f6dbbf034b">KEY_USER_PORT</a>,<a class="code hl_define" href="key__driver_8h.html#ac18ca23becb6fbf9db39bad55b127977">KEY_USER_PIN</a>);</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>    </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>    <span class="keywordflow">for</span>(<a class="code hl_enumeration" href="key__driver_8h.html#ab6420af507afd2c6a57f725ad69d11cb">key_type_e</a> key_type = <a class="code hl_enumvalue" href="key__driver_8h.html#ab6420af507afd2c6a57f725ad69d11cba8086b8579a3eab3a11c34672527b8103">KEY_USER_TYPE</a>;key_type &lt; <a class="code hl_enumvalue" href="key__driver_8h.html#ab6420af507afd2c6a57f725ad69d11cbae7c96674990975ac5a27143a3eb4be42">KEY_MAX_TYPE</a>;key_type++)</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>    {</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>        <span class="keywordflow">switch</span>(<a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].key_event)</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>        {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>            <span class="keywordflow">case</span> (<a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621af9e21966bc90237a39293a2772ed206b">KEY_IDLE_EVENT</a>):</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>                <span class="keywordflow">if</span>(key_status == GPIO_PIN_RESET)</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>                {</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>                    <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_event</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621a60594f7014b19b0dc2f4a9d314ea704b">KEY_TRIGGER_EVENT</a>;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>                    key_tick = HAL_GetTick();</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>                }</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>                <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>                </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>            <span class="keywordflow">case</span> (<a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621a60594f7014b19b0dc2f4a9d314ea704b">KEY_TRIGGER_EVENT</a>):</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>                system_tick = HAL_GetTick();</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>                <span class="keywordflow">if</span>((key_status == GPIO_PIN_SET) &amp;&amp; (system_tick - key_tick &gt; 50) &amp;&amp; (system_tick - key_tick &lt; 3000))</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>                {</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>                    <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_event</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621ace0da6b582f6e10c77205c9b5248bb82">KEY_SHORT_EVENT</a>;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>                    key_tick = system_tick;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>                }</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>                <span class="keywordflow">else</span> <span class="keywordflow">if</span>((key_status == GPIO_PIN_RESET) &amp;&amp; (system_tick - key_tick &gt; 3000))</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>                {</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>                    <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_event</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621a26c3e0aa7573f5cd061fca60cbb6987f">KEY_LONG_EVENT</a>;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>                    key_tick = system_tick;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>                }</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>                <span class="keywordflow">else</span> <span class="keywordflow">if</span>(system_tick - key_tick &gt; 3000)</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>                {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>                    <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_event</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621af9e21966bc90237a39293a2772ed206b">KEY_IDLE_EVENT</a>;</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>                    key_tick = system_tick;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>                }</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>                <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>            </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>            <span class="keywordflow">case</span> (<a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621ace0da6b582f6e10c77205c9b5248bb82">KEY_SHORT_EVENT</a>):</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>                system_tick = HAL_GetTick();</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>                <span class="keywordflow">if</span>(key_status == GPIO_PIN_RESET &amp;&amp; system_tick - key_tick &lt; 100)</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>                {</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>                    <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_event</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621ad70e00cee64db4a6186bc3d237af4d5e">KEY_DOUBLE_EVENT</a>;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>                    key_tick = system_tick;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>                }</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>                <span class="keywordflow">else</span> <span class="keywordflow">if</span>(system_tick - system_tick &gt; 100)</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>                {</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>                    <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a53d333982aba89badf7c12d4303945db">key_result</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9a4f8ce83ad6c2a446a085914beec179b3">KEY_SHORT_PRESS</a>;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>                    <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_event</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621af9e21966bc90237a39293a2772ed206b">KEY_IDLE_EVENT</a>;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>                    xQueueSend(<a class="code hl_variable" href="key__driver_8c.html#ae1ed7a538d655ebf902f732c4c064246">key_driver_event_queue</a>,&amp;<a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].key_result,100);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>                }</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>                <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>            </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span>            <span class="keywordflow">case</span> (<a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621a26c3e0aa7573f5cd061fca60cbb6987f">KEY_LONG_EVENT</a>):</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>                <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a53d333982aba89badf7c12d4303945db">key_result</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9a716a6af25c5127f80677c673c29142b2">KEY_LONG_PRESS</a>;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>                <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_event</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621af9e21966bc90237a39293a2772ed206b">KEY_IDLE_EVENT</a>;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>                xQueueSend(<a class="code hl_variable" href="key__driver_8c.html#ae1ed7a538d655ebf902f732c4c064246">key_driver_event_queue</a>,&amp;<a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].key_result,100);</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>                <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>            </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>            <span class="keywordflow">case</span> (<a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621ad70e00cee64db4a6186bc3d237af4d5e">KEY_DOUBLE_EVENT</a>):</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>                <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a53d333982aba89badf7c12d4303945db">key_result</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9ae26e139f2d1b9308c197e5ef60ab5e82">KEY_DOUBLE_PRESS</a>;</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>                <a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].<a class="code hl_variable" href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_event</a> = <a class="code hl_enumvalue" href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621af9e21966bc90237a39293a2772ed206b">KEY_IDLE_EVENT</a>;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>                xQueueSend(<a class="code hl_variable" href="key__driver_8c.html#ae1ed7a538d655ebf902f732c4c064246">key_driver_event_queue</a>,&amp;<a class="code hl_variable" href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a>[key_type].key_result,100);</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>                <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>            </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>            <span class="keywordflow">default</span>:</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>                <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>        }</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>    }</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>}</div>
</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span> </div>
<div class="foldopen" id="foldopen00094" data-start="{" data-end="}">
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="key__driver_8c.html#af9b55c8fe900842c9bf08f4ec8820525">   94</a></span><span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code hl_function" href="key__driver_8c.html#af9b55c8fe900842c9bf08f4ec8820525">key_get_result</a>(<a class="code hl_enumeration" href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9">key_result_e</a> * key_result)</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>{</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>    <span class="keywordflow">if</span>(xQueueReceive(<a class="code hl_variable" href="key__driver_8c.html#ae1ed7a538d655ebf902f732c4c064246">key_driver_event_queue</a>,key_result,portMAX_DELAY) == pdTRUE)</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>        <span class="keywordflow">return</span> 1;</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>    <span class="keywordflow">return</span> 0;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>}</div>
</div>
<div class="ttc" id="akey__driver_8c_html_a17906da8446cb27d67dd9d4f0b42826d"><div class="ttname"><a href="key__driver_8c.html#a17906da8446cb27d67dd9d4f0b42826d">key_init</a></div><div class="ttdeci">static void key_init(void)</div><div class="ttdef"><b>Definition</b> <a href="#l00017">key_driver.c:17</a></div></div>
<div class="ttc" id="akey__driver_8c_html_a4f12cfccd0746cb5d5961dc9556a3dd0"><div class="ttname"><a href="key__driver_8c.html#a4f12cfccd0746cb5d5961dc9556a3dd0">key_task</a></div><div class="ttdeci">static void key_task(void)</div><div class="ttdef"><b>Definition</b> <a href="#l00022">key_driver.c:22</a></div></div>
<div class="ttc" id="akey__driver_8c_html_a7a60855ebf18b91bc94321ec79ab1de6"><div class="ttname"><a href="key__driver_8c.html#a7a60855ebf18b91bc94321ec79ab1de6">key_driver</a></div><div class="ttdeci">key_driver_t key_driver[KEY_MAX_TYPE]</div><div class="ttdef"><b>Definition</b> <a href="#l00007">key_driver.c:7</a></div></div>
<div class="ttc" id="akey__driver_8c_html_aa38c85bdc6d45115e37716fb056cd79a"><div class="ttname"><a href="key__driver_8c.html#aa38c85bdc6d45115e37716fb056cd79a">key_driver_ops</a></div><div class="ttdeci">key_driver_ops_t key_driver_ops</div><div class="ttdef"><b>Definition</b> <a href="#l00011">key_driver.c:11</a></div></div>
<div class="ttc" id="akey__driver_8c_html_ae1ed7a538d655ebf902f732c4c064246"><div class="ttname"><a href="key__driver_8c.html#ae1ed7a538d655ebf902f732c4c064246">key_driver_event_queue</a></div><div class="ttdeci">static QueueHandle_t key_driver_event_queue</div><div class="ttdef"><b>Definition</b> <a href="#l00009">key_driver.c:9</a></div></div>
<div class="ttc" id="akey__driver_8c_html_af9b55c8fe900842c9bf08f4ec8820525"><div class="ttname"><a href="key__driver_8c.html#af9b55c8fe900842c9bf08f4ec8820525">key_get_result</a></div><div class="ttdeci">static int key_get_result(key_result_e *key_result)</div><div class="ttdef"><b>Definition</b> <a href="#l00094">key_driver.c:94</a></div></div>
<div class="ttc" id="akey__driver_8h_html"><div class="ttname"><a href="key__driver_8h.html">key_driver.h</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a640147b8dce97b1a49d8c6de0cdfe8d9"><div class="ttname"><a href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9">key_result_e</a></div><div class="ttdeci">key_result_e</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00018">key_driver.h:19</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a640147b8dce97b1a49d8c6de0cdfe8d9a4f8ce83ad6c2a446a085914beec179b3"><div class="ttname"><a href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9a4f8ce83ad6c2a446a085914beec179b3">KEY_SHORT_PRESS</a></div><div class="ttdeci">@ KEY_SHORT_PRESS</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00021">key_driver.h:21</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a640147b8dce97b1a49d8c6de0cdfe8d9a716a6af25c5127f80677c673c29142b2"><div class="ttname"><a href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9a716a6af25c5127f80677c673c29142b2">KEY_LONG_PRESS</a></div><div class="ttdeci">@ KEY_LONG_PRESS</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00022">key_driver.h:22</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a640147b8dce97b1a49d8c6de0cdfe8d9ae26e139f2d1b9308c197e5ef60ab5e82"><div class="ttname"><a href="key__driver_8h.html#a640147b8dce97b1a49d8c6de0cdfe8d9ae26e139f2d1b9308c197e5ef60ab5e82">KEY_DOUBLE_PRESS</a></div><div class="ttdeci">@ KEY_DOUBLE_PRESS</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00023">key_driver.h:23</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a7a236ca3a930ad4e78c2801d93d0c621"><div class="ttname"><a href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621">key_event_e</a></div><div class="ttdeci">key_event_e</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00027">key_driver.h:28</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a7a236ca3a930ad4e78c2801d93d0c621a26c3e0aa7573f5cd061fca60cbb6987f"><div class="ttname"><a href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621a26c3e0aa7573f5cd061fca60cbb6987f">KEY_LONG_EVENT</a></div><div class="ttdeci">@ KEY_LONG_EVENT</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00032">key_driver.h:32</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a7a236ca3a930ad4e78c2801d93d0c621a60594f7014b19b0dc2f4a9d314ea704b"><div class="ttname"><a href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621a60594f7014b19b0dc2f4a9d314ea704b">KEY_TRIGGER_EVENT</a></div><div class="ttdeci">@ KEY_TRIGGER_EVENT</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00030">key_driver.h:30</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a7a236ca3a930ad4e78c2801d93d0c621ace0da6b582f6e10c77205c9b5248bb82"><div class="ttname"><a href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621ace0da6b582f6e10c77205c9b5248bb82">KEY_SHORT_EVENT</a></div><div class="ttdeci">@ KEY_SHORT_EVENT</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00031">key_driver.h:31</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a7a236ca3a930ad4e78c2801d93d0c621ad70e00cee64db4a6186bc3d237af4d5e"><div class="ttname"><a href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621ad70e00cee64db4a6186bc3d237af4d5e">KEY_DOUBLE_EVENT</a></div><div class="ttdeci">@ KEY_DOUBLE_EVENT</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00033">key_driver.h:33</a></div></div>
<div class="ttc" id="akey__driver_8h_html_a7a236ca3a930ad4e78c2801d93d0c621af9e21966bc90237a39293a2772ed206b"><div class="ttname"><a href="key__driver_8h.html#a7a236ca3a930ad4e78c2801d93d0c621af9e21966bc90237a39293a2772ed206b">KEY_IDLE_EVENT</a></div><div class="ttdeci">@ KEY_IDLE_EVENT</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00029">key_driver.h:29</a></div></div>
<div class="ttc" id="akey__driver_8h_html_ab6420af507afd2c6a57f725ad69d11cb"><div class="ttname"><a href="key__driver_8h.html#ab6420af507afd2c6a57f725ad69d11cb">key_type_e</a></div><div class="ttdeci">key_type_e</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00012">key_driver.h:13</a></div></div>
<div class="ttc" id="akey__driver_8h_html_ab6420af507afd2c6a57f725ad69d11cba8086b8579a3eab3a11c34672527b8103"><div class="ttname"><a href="key__driver_8h.html#ab6420af507afd2c6a57f725ad69d11cba8086b8579a3eab3a11c34672527b8103">KEY_USER_TYPE</a></div><div class="ttdeci">@ KEY_USER_TYPE</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00014">key_driver.h:14</a></div></div>
<div class="ttc" id="akey__driver_8h_html_ab6420af507afd2c6a57f725ad69d11cbae7c96674990975ac5a27143a3eb4be42"><div class="ttname"><a href="key__driver_8h.html#ab6420af507afd2c6a57f725ad69d11cbae7c96674990975ac5a27143a3eb4be42">KEY_MAX_TYPE</a></div><div class="ttdeci">@ KEY_MAX_TYPE</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00016">key_driver.h:15</a></div></div>
<div class="ttc" id="akey__driver_8h_html_ac024ba8a2e4f54e21cbca3f6dbbf034b"><div class="ttname"><a href="key__driver_8h.html#ac024ba8a2e4f54e21cbca3f6dbbf034b">KEY_USER_PORT</a></div><div class="ttdeci">#define KEY_USER_PORT</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00009">key_driver.h:9</a></div></div>
<div class="ttc" id="akey__driver_8h_html_ac18ca23becb6fbf9db39bad55b127977"><div class="ttname"><a href="key__driver_8h.html#ac18ca23becb6fbf9db39bad55b127977">KEY_USER_PIN</a></div><div class="ttdeci">#define KEY_USER_PIN</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00010">key_driver.h:10</a></div></div>
<div class="ttc" id="astructkey__driver__ops__t_html"><div class="ttname"><a href="structkey__driver__ops__t.html">key_driver_ops_t</a></div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00043">key_driver.h:44</a></div></div>
<div class="ttc" id="astructkey__driver__ops__t_html_ac782f82d4153a23005349b6168768b27"><div class="ttname"><a href="structkey__driver__ops__t.html#ac782f82d4153a23005349b6168768b27">key_driver_ops_t::pfinit</a></div><div class="ttdeci">void(* pfinit)(void)</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00045">key_driver.h:45</a></div></div>
<div class="ttc" id="astructkey__driver__t_html"><div class="ttname"><a href="structkey__driver__t.html">key_driver_t</a></div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00037">key_driver.h:38</a></div></div>
<div class="ttc" id="astructkey__driver__t_html_a53d333982aba89badf7c12d4303945db"><div class="ttname"><a href="structkey__driver__t.html#a53d333982aba89badf7c12d4303945db">key_driver_t::key_result</a></div><div class="ttdeci">key_result_e key_result</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00039">key_driver.h:39</a></div></div>
<div class="ttc" id="astructkey__driver__t_html_a5576dde9abaab79f4aae436ffd89ce4a"><div class="ttname"><a href="structkey__driver__t.html#a5576dde9abaab79f4aae436ffd89ce4a">key_driver_t::key_event</a></div><div class="ttdeci">key_event_e key_event</div><div class="ttdef"><b>Definition</b> <a href="key__driver_8h_source.html#l00040">key_driver.h:40</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
